<template>
  <div><preHeader></preHeader>
  <div class="top-block"></div>
  <my-notice v-if="ordersInfo == null "></my-notice>
  <div class="item" v-for="(item,index) in ordersInfo" :key='index'>
    <div class="item-header">
      <span class="order-number">订单号：{{item.orderno}}</span>
      <span class="order-time">{{new Date(parseInt(item.paytime) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ')}} </span>
    </div>
    <div class="content">
      <div class="name">用户名：{{item.name}}</div>
      <div class="tel">手机号：{{item.tel}}</div>
      <div class="username">充值游戏：{{item.game_account}}</div>
      <div>充值金额：{{item.fee}}</div>
      <div class="area">分区：{{item.zonename}}</div>
    </div>
  </div>
  </div>
</template>

<script>
  import {get_orders} from '@/api/';
  export default {
    data(){
      return{
        tel:'',
        ordersInfo:''//订单信息
      }
    },
    methods:{
      getOreders(){
        this.tel = JSON.parse(localStorage.getItem('tel'));
        get_orders({tel:this.tel}).then(res =>{
          // console.log(res)
          this.ordersInfo = res.data;
        })
      }
    },
    mounted() {
      this.getOreders();
    }
  }
</script>

<style scoped>
.item{margin: 1em;font-size: 14px;border: 1px solid #aaa;padding: 10px;border-radius: 6px;}
.item-header{border-bottom: 1px solid #ccc;padding-bottom: 2px;color: #777;}
.item-header .order-time{float: right;}
.content{margin-top: 6px;color: #333;}
</style>
